package com.sina.medical.core.base;

import com.sina.medical.web.PagingForm;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Transient;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 查询基类  继承自PagingForm
 */
public class BaseCriteria extends PagingForm {


    /**
     * 查询起点
     */
    @DateTimeFormat(pattern = "uuuu-MM-dd HH:mm:ss")
    @Transient
    private transient LocalDateTime createStart;

    /**
     * 查询起点
     */
    @DateTimeFormat(pattern = "uuuu-MM-dd HH:mm:ss")
    @Transient
    private transient LocalDateTime createEnd;


    @Transient
    @Size(max = 2)
    private transient List<String> sortItems;


    public List<String> getSortItems() {
        return sortItems;
    }

    public BaseCriteria setSortItems(List<String> sortItems) {
        this.sortItems = sortItems;
        return this;
    }

    public LocalDateTime getCreateStart() {
        return createStart;
    }

    public BaseCriteria setCreateStart(LocalDateTime createStart) {
        this.createStart = createStart;
        return this;
    }

    public LocalDateTime getCreateEnd() {
        return createEnd;
    }

    public BaseCriteria setCreateEnd(LocalDateTime createEnd) {
        this.createEnd = createEnd;
        return this;
    }
}
